// $Id: AnswerForm.cs 10 2008-02-29 15:58:02Z mcartoixa $
/*
 *  Copyright (C) 2007 Noury Solutions
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 3 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 */
/*! \file
 * \brief Definition of \c Salamanca.DataActivities.UI.Forms.AnswerForm.
 *
 * \author $Author: mcartoixa $
 * \date $Date: 2008-02-29 16:58:02 +0100 (ven., 29 févr. 2008) $
 * \version $Revision: 10 $
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace Salamanca.DataActivities.UI.Forms
{



    ///////////////////////////////////////////////////////////////////////////
    ///
    /// <summary>Base class for a <see cref="Form" /> that will answer a <see cref="Question" />.</summary>
    ///
    ///////////////////////////////////////////////////////////////////////////

    [DesignTimeVisible(false)]
    [ComVisible(true)]
    [InitializationEvent("Load")]
    [DefaultEvent("Load")]
    [ClassInterface(ClassInterfaceType.AutoDispatch)]
    [ToolboxItem(false)]
    public partial class AnswerForm:
        Form
    {

        /// <summary>Initializes a new <see cref="AnswerForm" /> instance.</summary>
        public AnswerForm()
        {
            InitializeComponent();
        }

        /// <summary>Gets or sets the <see cref="IActivityController" /> associated to the form.</summary>
        [Browsable(false)]
        public IActivityController ActivityController
        {
            get
            {
                return _ActivityController;
            }
            set
            {
                _ActivityController=value;
            }
        }

        /// <summary>Gets the <see cref="AnswerController" /> associated to the form.</summary>
        protected AnswerController AnswerController
        {
            get
            {
                return _AnswerController;
            }
        }

        /// <summary>Gets the <see cref="QuestionProvider" /> associated to the form.</summary>
        protected QuestionProvider QuestionProvider
        {
            get
            {
                return _QuestionProvider;
            }
        }

        /// <summary>Raises the <see cref="Form.Shown" /> event.</summary>
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            if (!DesignMode)
                _ActivityController.Execute();
        }

        private IActivityController _ActivityController;
    }
}